#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <queue>

using namespace std;
using LL = long long;
using PII = pair<int, int>;
const int N = 110;

int n, m, t;
int dis[4][2] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}};
int f[N][N][20];
int g[N][N];
int sx, sy, ex, ey;
string st;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n >> m >> t;
    for(int i = 1; i <= n; i ++){
        cin >> st;
        for(int j = 1; j <= m; j ++){
            if(st[j - 1] == '*'){
                g[i][j] = 1;
            }
        }
    }

    cin >> sx >> sy >> ex >> ey;

    f[sx][sy][0] = 1;
    for(int k = 1; k <= t; k ++){
        for(int i = 1; i <= n; i ++){
            for(int j = 1; j <= m; j ++){
                if(g[i][j]) continue;
                for(int p = 0; p < 4; p ++){
                    int nx = i + dis[p][0], ny = j + dis[p][1];
                    if(nx < 1 || nx > n || ny < 1 || ny > m) continue;
                    if(g[nx][ny]) continue;
                    f[i][j][k] += f[nx][ny][k - 1]; 
                }
            }
        }
    }

    cout << f[ex][ey][t] << '\n';


    return 0;
}